package com.hua.api.modules.finance.dao;


import com.hua.api.core.constants.Status;
import com.hua.api.core.framework.statement.EntityManagerTemplate;
import com.hua.api.core.framework.statement.Statement;
import com.hua.api.core.framework.statement.mysql.StatementFactoryImpl;
import com.hua.api.modules.finance.domain.UserAccount;
import com.hua.api.modules.order.domain.OrderBid;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public class UserAccountDao extends EntityManagerTemplate {



    public UserAccount findUserAccountUseShopId(Integer shopId){
        Statement stms = StatementFactoryImpl.getInstance().createStatement("select ua from UserAccount ua,ShopInfo s where ua.userId=s.userId and s.id=?1");
            stms.addParam(shopId);
        return findObject(stms,UserAccount.class);
    }

    public UserAccount findUserAccountUseId(Integer userId){
        Statement stms = StatementFactoryImpl.getInstance().createStatement("select ua from UserAccount ua where ua.userId=?1");
        stms.addParams(userId);
        return findObject(stms,UserAccount.class);
    }


}
